<template>
  <div class="myfooter">
    <!-- <van-tabbar v-model="active" fixed>
            <van-tabbar-item name="home" icon="home-o">首页</van-tabbar-item>
            <van-tabbar-item name="search" icon="send-gift-o">市集</van-tabbar-item>
            <van-tabbar-item name="friends" icon="like-o">收藏</van-tabbar-item>
            <van-tabbar-item name="setting" icon="manager-o">我的</van-tabbar-item>
        </van-tabbar> -->
    <van-tabbar route>
      <van-tabbar-item replace to="/" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item replace to="/market" icon="send-gift-o"
        >市集</van-tabbar-item
      >
      <!-- @click="collect" @click="personal" to="/collect" to="/personal" -->
      <van-tabbar-item replace @click="collect" icon="like-o"
        >收藏</van-tabbar-item
      >
      <van-tabbar-item replace @click="personal" icon="manager-o"
        >我的</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>
<script>
export default {
  data() {
    return {
      active: "home",
    };
  },
  mounted() {},
  methods: {
    collect() {
      if (!this.$store.state.uname) {
        this.$dialog.alert({
          message: "您还未登录😅，需要登录一下哦，没有账号可以免费注册一个😘",
        });

        this.$router.push("/register");
      } else {
        window.Location;
        this.$router.push("/collect");
      }
    },
    personal() {
      if (!this.$store.state.uname) {
        this.$dialog.alert({
          message: "您还未登录😅，需要登录一下哦，没有账号可以免费注册一个😘",
        });
        this.$router.push("/register");
      } else {
        this.$router.push("/personal");
      }
    },
  },
};
</script>
